<?php
$title = '登录';
/** @var array|null $error */
require __DIR__ . '/../partials/head.php';
?>
<section class="section" style="padding-top:80px;">
    <div class="app-container" style="max-width:440px;">
        <div class="card" style="gap:24px;">
            <div>
                <h2 style="margin-bottom:6px;">欢迎回来</h2>
                <p style="color:var(--text-secondary);margin:0;">输入账户信息继续交易。</p>
            </div>
            <?php if (!empty($error)): ?>
                <div style="padding:12px 16px;border-radius:12px;background:rgba(255,0,0,0.08);color:#c0392b;">
                    <?= htmlspecialchars($error['message'] ?? '登录失败') ?>
                </div>
            <?php endif; ?>
            <form method="post" action="/login" style="display:flex;flex-direction:column;gap:18px;">
                <div class="field">
                    <label for="email">邮箱</label>
                    <input type="email" id="email" name="email" placeholder="you@example.com" required>
                </div>
                <div class="field">
                    <label for="password">密码</label>
                    <input type="password" id="password" name="password" required>
                </div>
                <div class="field">
                    <label for="otp_code">动态验证码（若已开启 2FA）</label>
                    <input type="text" id="otp_code" name="otp_code" placeholder="6 位数字">
                </div>
                <button class="btn" type="submit">登录</button>
            </form>
            <p style="color:var(--text-secondary);font-size:0.9rem;margin:0;">没有账号？<a href="/register">立即注册</a></p>
        </div>
    </div>
</section>
<?php require __DIR__ . '/../partials/footer.php'; ?>
